﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ToolRental.Services;
using System.ServiceModel;

namespace ToolRental.Host
{
    class Program
    {

        private static ServiceHost myServiceHost;

        static void Main(string[] args)
        {
            try
            {
                myServiceHost = new ServiceHost(typeof(AdminService));
                myServiceHost.Open();
                Console.WriteLine("Press <ENTER> to terminate the host application");
                Console.ReadLine();
            }
            finally
            {
                if (myServiceHost.State != CommunicationState.Closed)
                myServiceHost.Close();
            }
        }
    }
}
